<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page language="java" import="com.jxLC.Action.*"%>
<%@ page language="java" import="com.jxLC.Model.*" %>
<%@ page language="java" import="com.jxLC.Service.*" %>
<%@ page import="com.jxLC.util.*"%>
<%@include file="/checkLoginSession.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
UserService uService=new UserService();
List<User> uList=new ArrayList<User>();
uList=uService.list();
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>:::江西低碳-管理员后台:::</title>
	<link href="/mycss/my.css"  rel="stylesheet" type="text/css" />
	<link href="/mycss/details.css"  rel="stylesheet" type="text/css" />
	<script type="text/javascript" charset="utf-8" src="kindeditor/kindeditor.js"></script>
	<script type="text/javascript" src="/myjs/my.js"></script>
	<style type="text/css">
	 table,td,th{ font-size:14px； font-family: "宋体 "; border:1px solid #339966;border-collapse:collapse; }
	 th{background:#EBFCF3;}
	 #m{background-color:white}
	 #ma{height:30px; background-image:url(../my.photo/photo/h3.jpg); color:white;padding-top:5px;}
	 #mb{float: left; width:240px;height:100%; background-color: ; margin:3px;}
	 #mb2{height:30px;background-color:#339966;width:220px; color:white; padding:6px;margin-top:2px;font-weight: bold; }
	 #mb3 a{ text-decoration: none; color:#006699;font-size:14px; font-weight: bold;}
	 #mb3 a:hover{color:green}
	 #mc{float: left;}
	 #mc1{height:10px;background-color: #339966; width:98%;padding-left:4px;margin-top:4px;overflow:hidden;}
	 #mc2{padding-left:10px;margin-top:30px;border-bottom:1px dashed green;width:98%;}
	 #mc3{margin-top:10px;}
	 #mc5{margin-top:40px;}
	 table a{text-decoration: none;font-size:13px;color:blue}
	 table a:hover{ color:red }  
	 table{ font-size:18px;font-family:"宋";}
    </style>
    <script type="text/javascript">
 
  window.onload=function()
{ 
     var result ="<%=request.getAttribute("userdelete")%>";
     var result1 ="<%=request.getAttribute("addsuccess")%>";                                        
     if(result!='null'  &&  result!=undefined)
     {
           alert(result);
     }  
     if(result1!='null'  &&  result1!=undefined)
     {
           alert(result1);
     }  
}
	</script>
  </head>
  
 <body style="background-color:#EBFCF3">
    <s:include value="/admin/header.jsp"></s:include>
	<center><div id="m" >
       <div id="ma">
         <marquee direction="left" behavior="scroll" loop="0" onMouseOut="this.start()" onMouseOver="this.stop()" scrollamount="4" scrolldelay="4" >
		    这里是江西国际低碳与生态技术交流合作中心！欢迎进入管理员后台
		</marquee>
       </div>
       <div id="mb">	
          <div id="mb1"><img src="/my.photo/photo/g.jpg"></div>
          <div id="mb2"><p align="left">===》》后台功能</p></div>
          <div id="mb3">
		   <table style="height:260px; width:220px; border:1px">
		     <tr><td><img src="/my.photo/photo/list.gif" />&nbsp;&nbsp;<a href="index.jsp"> 管理员信息管理</a></td></tr>
		     <tr><td><img src="/my.photo/photo/list.gif" />&nbsp;&nbsp;<a href="usermanage.jsp"> 企业用户信息管理</a></td></tr>
		     <tr><td><img src="/my.photo/photo/list.gif" />&nbsp;&nbsp;<a href="contentup.jsp"> 在线文件上传</a></td></tr>
		     <tr><td><img src="/my.photo/photo/list.gif" />&nbsp;&nbsp;<a href="imageUpload.jsp"> 首页动态图片上传</a></td></tr>
		     <tr><td><img src="/my.photo/photo/list.gif" />&nbsp;&nbsp;<a href="choicefile.jsp"> 审核用户上传文件</a></td></tr>
		    </table>
		  </div>
		</div>
       <div id="mc">
          <div id="mc1"></div>
          <div id="mc2">
           <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">当前用户：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;">管理员</font></h4>
           <h4 align="left"><img  src="/my.photo/photo/to.gif"><font style="color:black;font-family: 仿宋 ;font-weight: bold;">当前位置：</font><font style="color:blue;font-family: 仿宋 ;font-weight: bold;">企业用户信息管理</font></h4>
          </div>
          <div id="mc3">
          <div id="mc5"><font style="font-size:16px;font-weight:bold">用户信息表</font></div>
          <!--<img src="/my.photo/photo/logo/icons/add.png" ><input type="button"  style="font-weight:bold;" value="添加新用户 " onclick="Do()"/>
          <script type="text/javascript">
					function Do(){
					window.location.href="../admin/zhuce.jsp";
					}
					</script>
           --><table width="700" height="100" style="margin-top:10px">             
             <tr height="40">
               <th>序号</th> <th>用户编号</th> <th>所在单位</th><th>查看与操作</th>
             </tr>
              <%
              int pageSize=8;             //每页显示条数
              int recordCount=uList.size();  //总记录数
              int currentPage=1;          //当前页
              int  j;
              String currentPageStr=request.getParameter("page");
              if(currentPageStr !=null){
              currentPage=Integer.parseInt(currentPageStr);
               }
              PageUtil pageUtil =new PageUtil(pageSize,recordCount,currentPage);
              j=(currentPage-1)*8+1;
              for(int i=pageUtil.getFromIndex();i<pageUtil.getToIndex();i++)
              {
        	  User user=uList.get(i);
             %>
         <tr >
          <td height="30" align="center"><font style="font-size: 14px;"><%=j%></font></td>
          <td height="30" align="center"><font style="font-size: 14px;"><%=user.getCnum() %></font></td>
          <td height="30" align="center"><font style="font-size: 14px;"><font style="font-size:12px;"><%=user.getCOname() %></font></font></td>
          <td height="30" align="center"><a href="userdetail.jsp?CNum=<%=user.getCnum() %>">查看用户详细信息</a>  || <a href="deleteuser.action?CNum=<%=user.getCId() %>" onclick="return confirm('确定要删除吗？')">删除用户</a></td>
         </tr>
             <%
             j++;
              }
             %>
             <tr>
       <td colspan="4" height="40"   align="center">
           <font style="font-size: 14px;"> 记录总数<%=recordCount %>条   每页显示<%=pageSize %>条   当前页/总页数  <%=pageUtil.getCurrentPage() %>/<%=pageUtil.getPageCount() %>
           <a href="usermanage.jsp?page=1">首页</a>  
           <a href="usermanage.jsp?page=<%=pageUtil.getPrevPage() %>">上页 </a>|       
           <a href="usermanage.jsp?page=<%=pageUtil.getNextPage() %>">下页 </a>|
           <a href="usermanage.jsp?page=<%=pageUtil.getPageCount() %>">末页 </a>
              跳到<input type="text" size="3" id="newPage">页 </font>
        <input type="button"  value="GO" onclick="processGoPage()" > 
           <script type="text/javascript">
				function processGoPage() {
			    var newPage = document.getElementById("newPage").value;
	            var reg = /\d+$/;	
	            if(!newPage.match(reg))	{
				alert('页面格式不合法');
				document.getElementById("newPage").focus();
				}
				else{
				window.location.href="usermanage.jsp?page="+newPage}
				}
          </script>
     </td>
  </tr> 
           </table>
          </div>
       </div>
	</div></center>
	<s:include value="/admin/tail.jsp"></s:include>
</body>
</html>
